import segmentation_models_pytorch as smp
import numpy as np

encoder = "resnet34"
weights = "imagenet"
preprocessing_fn = smp.encoders.get_preprocessing_fn(encoder, weights)

print(f"Preprocessing function: {preprocessing_fn}")

# Test with a dummy image
img = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
processed = preprocessing_fn(img)
print(f"Processed shape: {processed.shape}")
print(f"Processed range: {processed.min()} - {processed.max()}")
print(f"Processed mean: {processed.mean(axis=(0,1))}")
